home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 142
/
Volume 142 Oct 17 2011 - Damaged.iso
/
Games
/
parasite-x.swf
/
scripts
/
frame_8
/
DoAction.as
< prev
Wrap
Text File
|
2011-10-17
|
1KB
|
73 lines
Test.onEnterFrame = function()
{
if(_root.gamepaused == 0)
{
var _loc4_ = _root._xmouse;
var _loc3_ = _root._ymouse;
if(Math.abs(_loc4_ - this._x) < 1)
{
this._x = _loc4_;
}
else
{
this._x -= (this._x - _loc4_) / 12 - _root.handeling;
}
if(Math.abs(_loc3_ - this._y) < 1)
{
this._y = _loc3_;
}
else
{
this._y -= (this._y - _loc3_) / 12 - _root.handeling;
}
}
};
this.createEmptyMovieClip("draw",1);
length = 15;
speed = 1.5;
wind = 0;
gravity = 0;
i = 0;
while(i < length)
{
_root.createEmptyMovieClip("line" + i,i + 20);
i++;
}
this.onEnterFrame = function()
{
draw.clear();
i = 0;
while(i < length)
{
me = this["line" + i];
if(i == 0)
{
tx = _root.Test._x;
ty = _root.Test._y;
}
else
{
tx = this["line" + (i - 1)]._x;
ty = this["line" + (i - 1)]._y;
}
xdiff = (tx - me._x) / speed;
ydiff = (ty - me._y) / speed;
if(Math.abs(xdiff) > 1)
{
me._x += xdiff;
}
if(Math.abs(ydiff) > 1)
{
me._y += ydiff;
}
me._x += wind;
me._y += gravity;
draw.lineStyle(length - i,16777215,100);
draw.moveTo(me._x,me._y);
draw.lineTo(tx,ty);
me.swapDepths(1);
_root.Test.swapDepths(999);
i++;
}
};